package com.api.config.interceptors;

import cn.dev33.satoken.interceptor.SaInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * @author 李大牛家的牛 (scafel@163.com)
 * @product IntelliJ IDEA
 * @createDate 2025/5/20-13:32
 * @description TODO...
 **/
@Component
public class SaTokenInterceptors extends SaInterceptor {

    public InterceptorRegistry checkLoginInterceptors(InterceptorRegistry registry) {
        // 注册 Sa-Token 拦截器，校验规则为 StpUtil.checkLogin() 登录校验。
        registry.addInterceptor(new SaInterceptor())
                .addPathPatterns("/**");
        return registry;
    }

}
